import VueRouter from "vue-router";

import Vue from "vue";

import Home from "@/pages/Home"
import Login from "@/pages/Login"
import Music from "@/pages/Home/Music"

Vue.use(VueRouter)

export default new VueRouter({
    routes:[
        {
            path:"/home",
            component:Home,
            name:'Home',
            children:[
                {
                    path:"music/:id",
                    component:Music,
                    name:"Music",
                    props(routes){
                        return {...routes.query,...routes.params}
                    }
                }
            ]
        },
        {
            path:"/login",
            component:Login,
            name:'Login'
        },
        {
            path:'/',
            redirect:"/home"
        },
        {
            path:'*',
            redirect:"/home"
        }
    ]
})